export default class {
    ctx: any;
    app: any;
    next: any;
    request: any;
    response: any;

    constructor(ctx?: any, next?: any) {
        this.ctx = ctx;
        this.next = next;
        this.request = this.app.request;
        this.response = this.app.response;
    }

    success(message: any, code?: number) {
        (this.ctx.response.body
            = {
            code,
            message
        });
    }

    fail(message: any, code?: number) {
        this.ctx.response.body = {
            code,
            message
        };
    }
}